<?php

/*
|--------------------------------------------------------------------------
| Web Routes
|--------------------------------------------------------------------------
|
| Here is where you can register web routes for your application. These
| routes are loaded by the RouteServiceProvider within a group which
| contains the "web" middleware group. Now create something great!
|
*/

Route::get('/test', function () {


    $users = \App\Models\User::query()->where('users.id', '>', 8)->get();
    // $users = \App\Models\User::query()->where('users.id', '>', 8)->update(['name' => '1d56@qq.com']);

    echo '<pre>';
    print_r($users);

    return Debugbar::info($users);

    return $users;

    $users = \App\Models\User::query()->where('id', '>', 8)->with('order')->get();

    return $users;

    $object = \App\Models\User::query()->where('id', 110252)->with(['order'])->get();
//    dd($object);
//    var_dump($object);
    foreach($object as $item){
        if(isset($item->order)){
            foreach ($item->order as $order){
                dump($order);
            }
        }
        dump($item->toArray());
    }
//    dd($object);
    $object = \App\Models\User::query()->where('id', 1)->with(['order'])->first();
//    var_dump($object->toArray());
    // dd($object);
//    return \App\Models\User::query()->select('id', 'name')->where('id', 110252)->with(['order'])->get();
    return Debugbar::info($object);
});
Route::get('/', function () {
    return view('welcome');
});

